//
// Description: 5904. 统计按位或能得到最大值的子集数目
// Created by Loading on 2021/10/17.
//

#include <bits/stdc++.h>

using namespace std;

int countMaxOrSubsets(vector<int> &nums) {
    int n = nums.size();
    map<int, int> m;
    // 使用长度为 n 的二进制整数状态压缩
    for (int i = 1; i < 1 << n; ++i) {
        int res = 0;
        int index = 0;
        while (index < n) {
            if ((i >> index & 1) == 1) {
                res |= nums[index];
            }
            ++index;
        }
        m[res]++;
    }

    return (--m.end())->second;
}

int main() {
    vector<int> nums = {2, 2, 2};
    int res = countMaxOrSubsets(nums);
    cout << res << endl;

    return 0;
}